[3주차] 이건희/[feat] 게시글 도메인 API 구현#115
Open
KunHeeLee7 wants to merge 9 commits intoLeets-Official:이건희/mainfrom
Hidden character warning
The head ref may contain hidden characters: "\uc774\uac74\ud76c/3\uc8fc\ucc28"
Open
[3주차] 이건희/[feat] 게시글 도메인 API 구현#115KunHeeLee7 wants to merge 9 commits intoLeets-Official:이건희/mainfrom
KunHeeLee7 wants to merge 9 commits intoLeets-Official:이건희/mainfrom
Conversation
kangyeson
reviewed
Apr 9, 2026
|
|
||
| public class PostForbiddenException extends RuntimeException { | ||
| public PostForbiddenException() { | ||
| super("수정 권한이 없습니다."); |
There was a problem hiding this comment.
에러마다 예외처리를 하기 보다, Post도메인의 공통 예외처리부분을 만들어두고 에러코드를 ENUM으로 관리하면 더 효율적이고 깔끔하게 관리할 수 있을 것 같습니다!
| .result(null) | ||
| .build() | ||
| ); | ||
| } |
There was a problem hiding this comment.
GlobalExceptionHandler에는 모든 도메인에서 공통으로 사용하는 예외처리(인증실패, 서버에러)만을 담고, POST404_1과 같은 특정 도메인의 예외처리는 해당 도메인 Exception과 ErrorCode 아래에 만들어서 각 리소스의 역할을 명확히 구분해주신다면 좋을 것 같습니다!
Nanajun22
approved these changes
Apr 9, 2026
Comment on lines
+7
to
+22
| @Builder | ||
| public class ExceptionResponse { | ||
| private final boolean isSuccess; | ||
| private final String code; | ||
| private final String message; | ||
| private final Object result; | ||
|
|
||
| // 에러 발생 시 응답을 생성하는 정적 메서드 | ||
| public static ExceptionResponse of(String code, String message) { | ||
| return ExceptionResponse.builder() | ||
| .isSuccess(false) | ||
| .code(code) | ||
| .message(message) | ||
| .result(null) | ||
| .build(); | ||
| } |
There was a problem hiding this comment.
ApiResponse 와 exceptionResponse를 나누셨는데 공통응답포맷을 성공과 실패로 나누어야 할 필요가 있는지 나눈다면 어떤 이점이 있을지 알아보면 좋을 것 같습니다!
vyfhfhd
reviewed
Apr 9, 2026
vyfhfhd
left a comment
There was a problem hiding this comment.
주석을 상세히 적어주셔서 전체적인 흐름을 이해하는 데 도움이 많이 되었습니다 감사합니다! 수고하셨어요!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. 과제 요구사항 중 구현한 내용
2. 핵심 변경 사항
3. 실행 및 검증 결과
실행 결과:
[POST] 게시글 생성

[GET] 게시글 목록 조회

[GET] 특정 게시글 조회

[PATCH] 게시글 수정

[DELETE] 게시글 삭제

[POST400_1] 제목이나 내용 미입력시 예외처리

[POST400_2] 제목이 255자 초과시 예외처리

[POST404_1] 잘못된 {post-id} 일 때 예외처리

4. 완료 사항
5. 추가 사항
제출 체크리스트
{이름}/main브랜치다{이름}/{숫자}주차브랜치다Reviewer 참고